﻿namespace Web.Control.WWW.Contacts
{
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Collections;
    using Lx.Web.Common.ControlsUI;
    using Lx.Web.Common.UI;
    using Model;

    /// <summary>
    /// InviteFriends 的摘要说明
    /// </summary>
    public class InviteConfirm : BaseControl
    {
        /// <summary>
        /// 当前会员号
        /// </summary>
        protected string memberno = "";
        /// <summary>
        /// 添加朋友的会员号
        /// </summary>
        protected string FMemberno = "";
        /// <summary>
        /// 添加朋友的昵称
        /// </summary>
        protected string FNickName = "";
        /// <summary>
        /// 当前会员昵称名
        /// </summary>
        protected string MyNickName = "";
        /// <summary>
        /// 添加朋友的email
        /// </summary>
        protected string FEmail = "";
        /// <summary>
        /// 是否为朋友(1是,0否)
        /// </summary>
        protected int IsFriend;
        /// <summary>
        /// 是否是联系人(1是,0否)
        /// </summary>
        protected int IsLink;
        /// <summary>
        /// 是否同意加为朋友(1是,0否)
        /// </summary>
        protected int IsAgreeFriend;
        /// <summary>
        /// 邮件类型
        /// </summary>
        protected int EmailOption;
        protected override void OnLoad(EventArgs e)
        {
            memberno = HttpContext.Current.User.Identity.Name;
            if (memberno == "")
            {
                Page.Response.Redirect("/user/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
                return;
            }
            if (memberno == "" || Request["MemberNo"] == null)
            {
                Page.Response.End();
                return;
            }
            FMemberno = Request["MemberNo"].ToString();
            ArrayList outList;
            CommonMessage comMes = BLF.WWW_WWW.Contact.Contacts.MemberRelation(memberno, FMemberno, out outList);
            if (!comMes.State)
            {
                Response.Write(comMes.Msg);
                Response.End();
            }
            IsFriend = (bool)outList[0] == true ? 1 : 0;
            IsLink = (bool)outList[1] == true ? 1 : 0;
            IsAgreeFriend = (bool)outList[2] == true ? 1 : 0;
            EmailOption = (int)outList[3];
            FNickName = (string)outList[4];
            MyNickName = (string)outList[5];
            FEmail = (string)outList[6];
            base.OnLoad(e);
        }
    }
}